package cn.tedu.boot21.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;

@Controller
public class TestController {
    @RequestMapping("/test")
    public void test(HttpServletResponse response) throws IOException {
        System.out.println("收到请求");
        response.setContentType("text/html;charset=utf-8");
        PrintWriter pw =response.getWriter();
        pw.println("<h1>测试成功！</h1>");
        pw.close();
    }
}
